<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>验证码</title>
</head>
<body>
<div id="v_container" style="width: 200px;height: 50px"></div>
<input type="text" id="code_input" value=""/><button id="my_button">验证</button>

<script src="js/gVerify.js"></script>
<script>
    var verifyCode = new GVerify({id:"v_container",isLine:false});
    document.getElementById("my_button").onclick = function () {
        var res = verifyCode.validate(document.getElementById("code_input").value);
        if(res){
            alert("验证正确");
        }else {
            alert("验证错误");
        }
    }
</script>
</body>
</html>